package Test;

//以继承的方式创建的代理类

public class UserDAOProxyByExtend extends UserDAOImpl {
    private UserDAOImpl conreteUserDAO;

    public UserDAOProxyByExtend() {

    }
    public UserDAOProxyByExtend(UserDAOImpl conreteUserDAO) {
        this.conreteUserDAO = conreteUserDAO;
    }

    @Override
    public String insert(String name, int age) {
        conreteUserDAO.insert(name,age);
        return "我是代理类，收取代理费1000。";
    }
}
